/**
 * @param  {Function} fn 回调
 * @param  {Number} delay 延迟时间
 * @return {Function} 返回值
*/
function mySetInterval(fn, delay, ...args) {
  let cancel = false

  const task = () => {
    setTimeout(() => {
      if(!cancel) {
        fn.apply(this, args)
        task()
      }
    }, delay)
  }

  task()
  return () => { cancel = true };
}
